HighPassFilterA high-pass filter audio effector that attenuates frequencies below a configurable cutoff frequency. It is commonly used to remove low-frequency rumble, DC offsets, or to thin out signals in a mix.
Internally this effector runs its filtering inside the HighPassFilterProcessor AudioWorklet processor.
Extends Effector.
import { HighPassFilter } from "@fluex/fluexgl-dsp";
const highPass = new HighPassFilter({
cutoff: 200,
q: 0.7
});
...
channel.addEffect(highPass);
new HighPassFilter(options?: Partial<HighPassFilterOptions>): HighPassFilter;
options?: Partial<HighPassFilterOptions>
Optional high-pass filter configuration options (cutoff, q, strictMode). Defaults to { cutoff: 1000, q: 0.7, strictMode: StrictMode.Disabled } when omitted.label: string | nullCustom label for this effector. Defaults to "HighPassFilter".
name: stringInternal name for this effector. Defaults to "HighPassFilter".
cutoff: numberCutoff frequency in Hz. Defaults to 1000.
q: numberResonance/Q factor, clamped between 0.0001 and 4 by setQ(). Defaults to 0.7.
strictMode: StrictModeValidation mode passed through to the processor. Defaults to StrictMode.Disabled.
maxFrequency: numberUpper bound applied to cutoff by setCutoff(). Defaults to half of DEFAULT_SAMPLE_RATE (22050).
initializeOnAttachment(context: AudioContext): Promise<void>Initializes the filter by creating the AudioWorklet processor node (HighPassFilterProcessor) with the current option values.
context: AudioContextPromise<void>returnOptionsAsObject(): HighPassFilterOptionsReturns a plain object snapshot of the current cutoff, q, strictMode and maxFrequency values.
HighPassFilterOptionssetCutoff(cutoff?: number): booleanUpdates cutoff, clamped to at most maxFrequency and to the current context's sample rate, and forwards the change to the AudioWorklet processor.
cutoff?: number - Defaults to 1000 when omitted.boolean - false if this effect has no context yet, otherwise the result of sending the message to the processor.setMaxFrequency(maxFrequency?: number): booleanUpdates maxFrequency and forwards the change to the AudioWorklet processor. Throws if the given value exceeds half of the AudioContext's sample rate.
maxFrequency?: number - Defaults to the current maxFrequency when omitted.booleansetQ(q?: number): booleanUpdates q, clamped between 0.0001 and 4, and forwards the change to the AudioWorklet processor.
q?: number - Defaults to 0.7 when omitted.booleanInherited from Effector (incoming-processor-message, incoming-processor-warning, incoming-processor-error, processor-wasm-instantiated).
This class does not define public getters or setters.